<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        var d1 = "2013-10-01";
        var d2 = "2013-10-05";
        s1 = new Date(d1);
        s2 = new Date(d2);
        depart = (s2 - s1) / (1000 * 3600 * 24);
        alert(s1);
        alert(s2);
        alert(depart);
    </script>
</head>

<body>

</body>
</html>